package com.itheima.chapter07.exception;
//运行时异常
public class throws1 {
    public static void main(String[] args) {

        method();
        //调用者没进行处理，交给JVM虚拟机执行
    }
    //throws NullPointerException
    //告诉调用者你调用我可能会出现NullPointerException异常
    //若无异常，正常执行
    //若有异常，交给调用者执行
    private static void method() throws NullPointerException {
        int[] arr = null;
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}
